package com.xuecheng.content.api;

import com.xuecheng.content.model.po.CourseTeacher;
import com.xuecheng.content.service.CourseTeacherService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "课程教资编辑接口",tags = "课程教资编辑接口")
@RestController
@RequestMapping("/courseTeacher")
public class CourseTeacherController {
    @Autowired
    private CourseTeacherService courseTeacherService;

    @GetMapping("/list/{id}")
    public List<CourseTeacher> getCourseTeacher(@PathVariable Long id){
        List<CourseTeacher> courseTeacher = courseTeacherService.getCourseTeacher(id);
        return courseTeacher;
    }
    @PostMapping
    public void saveCourseTeacher(@RequestBody CourseTeacher courseTeacher){
        courseTeacherService.saveCourseTeacher(courseTeacher);
    }

    @DeleteMapping("/course/{courseId}/{id}")
    public void deleteCourseTeacher(@PathVariable Long courseId,@PathVariable Long id){
        courseTeacherService.deleteCourseTeacher(courseId,id);
    }
}
